package com.ktg.mes.md.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@Accessors(chain = true)
@TableName("md_item")
public class MdItem extends BaseEntity {

    private static final long serialVersionUID = 1L;

    public final static String mainSelectColumnNotId = "item_code,item_name,specification,viscosity,tag,unit_of_measure,packing_type,process_product_id,process_product_name";

    public final static String mainSelectColumnAppearance = "appearance,tag";

    /** 产品id */
    @TableId(value = "item_id", type = IdType.AUTO)
    private Long itemId;
    private String itemCode;
    private String itemName;
    private String specification;
    private String unitOfMeasure;
    private String itemOrProduct;
    private Long itemTypeId;
    private String itemTypeCode;
    private String itemTypeName;
    private String enableFlag;
    private String safeStockFlag;
    private Double minStock;
    private Double maxStock;
    private String attr1;
    private String attr2;
    private String attr3;
    private String attr4;

    private String mesType;

    private String mesTypeName;

    /** 有效期(月) */
    private Integer validTerm;
    /** 净重 */
    private String netWeight;
    /** 标识 */
    private String identification;
    /** 油墨类型 */
    private String inkType;
    /** 标准 */
    private String standard;

    /** 批号 */
    @TableField(exist = false)
    private String BatchNo;

    /** 生产日期 */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;
    /** 有效日期 */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "有效日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date validTime;

    /**名称*/
    @Excel(name = "名称", width = 15)
    @ApiModelProperty(value = "名称")
    private String currencyName;

    /**存货代码*/
    @Excel(name = "存货代码", width = 15)
    @ApiModelProperty(value = "存货代码")
    private String invAddCode;

    /**粘度*/
    @Excel(name = "粘度", width = 15)
    @ApiModelProperty(value = "粘度")
    private String viscosity;

    /**标签*/
    @Excel(name = "标签", width = 15)
    @ApiModelProperty(value = "标签")
    private String tag;

    /**包装规格*/
    @Excel(name = "包装规格", width = 15)
    @ApiModelProperty(value = "包装规格")
    private String packingType;

    /**税率*/
    @Excel(name = "税率", width = 15)
    @ApiModelProperty(value = "税率")
    private String taxRate;

    /**箱包装规格*/
    @Excel(name = "箱包装规格", width = 15)
    @ApiModelProperty(value = "箱包装规格")
    private String invBoxStd;

    /**安全资料*/
    @Excel(name = "安全资料", width = 15)
    @ApiModelProperty(value = "安全资料")
    private String safetyFile;
    /**第三方报告*/
    @Excel(name = "第三方报告", width = 15)
    @ApiModelProperty(value = "第三方报告")
    private String thirdReport;
    /**存货图片*/
    @Excel(name = "存货图片", width = 15)
    @ApiModelProperty(value = "存货图片")
    private String invImages;


    /**ERP数据变更标识*/
    @Excel(name = "ERP数据变更标识", width = 15)
    @ApiModelProperty(value = "ERP数据变更标识")
    private String pubufts;

    /** 计量单位编码 */
    @Excel(name = "计量单位编码")
    private String measureNo;


    @Excel(name = "本来作为工艺分类，后面陆续修改，作为产品统计名称，按同一个产品进行统计")
    private String processProductName;

    @Excel(name = "本来作为工艺分类，后面陆续修改，作为产品统计ID，按同一个产品进行统计")
    private Long processProductId;


    @Excel(name = "外观")
    private String appearance;

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

    @NotBlank(message = "物料产品编码不能为空")
    @Size(min = 0,max = 64,message = "物料产品编码长度不能超过64个字符")
    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    @NotBlank(message = "物料产品名称不能为空")
    @Size(min = 0,max = 255,message = "物料产品编码名称不能超过255个字符")
    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    @Size(min = 0,max = 500,message = "规格型号不能超过255个字符")
    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    @NotBlank(message = "单位不能为空")
    public String getUnitOfMeasure() {
        return unitOfMeasure;
    }

    public void setUnitOfMeasure(String unitOfMeasure) {
        this.unitOfMeasure = unitOfMeasure;
    }


    public String getItemOrProduct() {
        return itemOrProduct;
    }

    public void setItemOrProduct(String itemOrProduct) {
        this.itemOrProduct = itemOrProduct;
    }

    @NotNull(message = "物料类型不能为空")
    public Long getItemTypeId() {
        return itemTypeId;
    }

    public void setItemTypeId(Long itemTypeId) {
        this.itemTypeId = itemTypeId;
    }

    public String getMesType() {
        return mesType;
    }

    public void setMesType(String mesType) {
        this.mesType = mesType;
    }

    public String getMesTypeName() {
        return mesTypeName;
    }

    public void setMesTypeName(String mesTypeName) {
        this.mesTypeName = mesTypeName;
    }

    public String getProcessProductName() {
        return processProductName;
    }

    public void setProcessProductName(String processProductName) {
        this.processProductName = processProductName;
    }

    public Long getProcessProductId() {
        return processProductId;
    }

    public void setProcessProductId(Long processProductId) {
        this.processProductId = processProductId;
    }

    public String getAppearance() {
        return appearance;
    }
    public void setAppearance(String appearance) {
        this.appearance = appearance;
    }
}
